package com.wk.arth.od;

import java.util.Arrays;
import java.util.Scanner;

/**
 * 输入 : bcdefa
 * 输出：acdefb
 * 只交换一位变为最小，字典序
 * @author wukai
 * @date 2023/4/19 18:08
 */
public class String_change {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] chars = s.toCharArray();
        //Arrays.sort(chars);
        int start = 0;
        int end = 0;
        int min;
        for (int i=0;i<chars.length;i++){
            min = chars[i];
            for (int j = i+1;j<chars.length;j++){
                if(min>chars[j]){
                    min = chars[j];
                    start = i;
                    end = j;
                }
            }
            if(start != end){
                char tm = chars[start];
                chars[start] = chars[end];
                chars[end] = tm;
                break;
            }
        }
        System.out.println(chars);
    }
}
